package cn.tedu.csmall.product.schedule;

import cn.tedu.csmall.product.service.IBrandService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.xml.ws.Action;

@Slf4j
//@Component
public class CacheSchedule {
    @Autowired
    private IBrandService brandService;
    public CacheSchedule(){
        log.debug("创建任务计划对象: CacheSchedule");

    }

    @Scheduled(fixedRate = 1 * 60 * 1000)
    public void rebuildCache(){
        log.debug("开始执行[重建品牌缓存]计划任务......");
        brandService.rebuildCache();
        log.debug("本次[重建品牌缓存]计划任务执行完成!");
    }
}
